package com.ruoyi.finance.service.impl;

import com.ruoyi.finance.mapper.AccountMapper;
import com.ruoyi.finance.service.IAccountService;
import com.ruoyi.system.api.domain.finance.Account;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 账户Service业务层处理
 *
 * @author ruoyi
 * @date 2024-10-25
 */
@Service
public class AccountServiceImpl implements IAccountService {
    @Autowired
    private AccountMapper accountMapper;

    /**
     * 查询账户
     *
     * @param Id 账户主键
     * @return 账户
     */
    @Override
    public Account selectAccountById(Long Id) {
        return accountMapper.selectAccountById(Id);
    }

    /**
     * 查询账户列表
     *
     * @param account 账户
     * @return 账户
     */
    @Override
    public List<Account> selectAccountList(Account account) {
        return accountMapper.selectAccountList(account);
    }

    /**
     * 新增账户
     *
     * @param account 账户
     * @return 结果
     */
    @Override
    public int insertAccount(Account account) {
        return accountMapper.insertAccount(account);
    }

    /**
     * 修改账户
     *
     * @param account 账户
     * @return 结果
     */
    @Override
    public int updateAccount(Account account) {
        return accountMapper.updateAccount(account);
    }

    /**
     * 批量删除账户
     *
     * @param Ids 需要删除的账户主键
     * @return 结果
     */
    @Override
    public int deleteAccountByIds(Long[] Ids) {
        return accountMapper.deleteAccountByIds(Ids);
    }

    /**
     * 删除账户信息
     *
     * @param Id 账户主键
     * @return 结果
     */
    @Override
    public int deleteAccountById(Long Id) {
        return accountMapper.deleteAccountById(Id);
    }
}
